package org.example.controller;

import org.example.pojo.*;
import org.example.service.VisualService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/visual")
public class VisualController {
    @Autowired
    private VisualService visualService;
    @GetMapping
    public Result<List<Visual>> listVisual(){
        List<Visual> visual = visualService.list();
        return Result.success(visual);
    }
    @GetMapping("/TenYearAll")
    public Result<List<IETenYearAll>> listTenYearAll(){
        List<IETenYearAll> IETenYearAll = visualService.listTenYearAll();
        return Result.success(IETenYearAll);
    }
    @GetMapping("/TenYearDis")
    public Result<List<IETenYearDis>> listTenYearDis(){
        List<IETenYearDis> IETenYearDis = visualService.listTenYearDis();
        return Result.success(IETenYearDis);
    }
    @GetMapping("/Continent")
    public Result<List<IEContinent>> listContinent(){
        List<IEContinent> IEContinent = visualService.listContinent();
        return Result.success(IEContinent);
    }
    @GetMapping("/Country")
    public Result<List<IECountry>> listCountry(){
        List<IECountry> IECountry = visualService.listCountry();
        return Result.success(IECountry);
    }
    @GetMapping("/Countries")
    public Result<List<IECountry>> listCountries(){
        List<IECountry> IECountry = visualService.listCountries();
        return Result.success(IECountry);
    }
    @GetMapping("/Goods")
    public Result<List<IEByGoods>> listGoods(){
        List<IEByGoods> IEGoods = visualService.listGoods();
        return Result.success(IEGoods);
    }
}
